<html>
<head><meta charset="utf-8"><title>completion label filtering · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html">completion label filtering</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="158137272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158137272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158137272">(Feb 12 2019 at 17:52)</a>:</h4>
<p>This could be an issue, but I wanted to try out Zulip.</p>
<p><code>rust-analyzer</code> filters out comments in the function body for the completion detail area, but it keeps the attributes, and I'm not sure how useful they are, see below:</p>
<p><a href="/user_uploads/4715/l-HrK5ZEJpSGT5_d2taOnpJx/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/l-HrK5ZEJpSGT5_d2taOnpJx/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/l-HrK5ZEJpSGT5_d2taOnpJx/pasted_image.png"></a></div><p>Would it be a good idea to filter them out?</p>



<a name="158137373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158137373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158137373">(Feb 12 2019 at 17:53)</a>:</h4>
<p>Yeah, I think it's a good idea to remove the attributes.</p>



<a name="158137470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158137470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158137470">(Feb 12 2019 at 17:54)</a>:</h4>
<p>In general, I think we'll soon need to create a "more enterpriesy" module for rendering <code>defs</code> as completion items. Currently, completion code contains way to many "rendering" logic</p>



<a name="158137498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158137498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158137498">(Feb 12 2019 at 17:55)</a>:</h4>
<p>there's already a body range check, but it doesn't seem to work (or maybe it's doing something else)</p>



<a name="158138310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158138310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158138310">(Feb 12 2019 at 18:05)</a>:</h4>
<div class="codehilite"><pre><span></span>info: caused by: No space left on device (os error 28)
test check_code_formatting ... FAILED
</pre></div>


<p>Well, I didn't expect that one...</p>



<a name="158138668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158138668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158138668">(Feb 12 2019 at 18:11)</a>:</h4>
<div class="codehilite"><pre><span></span>thread &#39;completion::complete_dot::tests::test_method_body_filtering&#39; panicked at &#39;byte index 14 is out of bounds of ``&#39;, src/libcore/str/mod.rs:2026:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:209
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   6: rust_begin_unwind
             at src/libstd/panicking.rs:312
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::str::slice_error_fail
             at src/libcore/str/mod.rs:0
   9: core::str::traits::&lt;impl core::slice::SliceIndex&lt;str&gt; for core::ops::range::RangeFrom&lt;usize&gt;&gt;::index::{{closure}}
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/str/mod.rs:1893
  10: &lt;core::option::Option&lt;T&gt;&gt;::unwrap_or_else
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/option.rs:386
  11: core::str::traits::&lt;impl core::slice::SliceIndex&lt;str&gt; for core::ops::range::RangeFrom&lt;usize&gt;&gt;::index
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/str/mod.rs:1893
  12: core::str::traits::&lt;impl core::ops::index::Index&lt;I&gt; for str&gt;::index
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/str/mod.rs:1632
  13: &lt;alloc::string::String as core::ops::index::Index&lt;core::ops::range::RangeFrom&lt;usize&gt;&gt;&gt;::index
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/liballoc/string.rs:1973
  14: insta::runtime::format_rust_expression
             at /home/grayshade/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-0.6.2/src/runtime.rs:62
  15: insta::runtime::print_changeset
             at /home/grayshade/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-0.6.2/src/runtime.rs:174
  16: insta::runtime::print_snapshot_diff
             at /home/grayshade/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-0.6.2/src/runtime.rs:298
  17: insta::runtime::print_snapshot_diff_with_title
             at /home/grayshade/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-0.6.2/src/runtime.rs:317
  18: insta::runtime::assert_snapshot
             at /home/grayshade/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-0.6.2/src/runtime.rs:404
  19: ra_ide_api::completion::completion_item::check_completion
             at crates/ra_ide_api/src/completion/completion_item.rs:363
  20: ra_ide_api::completion::complete_dot::tests::check_ref_completion
             at crates/ra_ide_api/src/completion/complete_dot.rs:88
  21: ra_ide_api::completion::complete_dot::tests::test_method_body_filtering
             at crates/ra_ide_api/src/completion/complete_dot.rs:184
  22: ra_ide_api::completion::complete_dot::tests::test_method_body_filtering::{{closure}}
             at crates/ra_ide_api/src/completion/complete_dot.rs:183
  23: core::ops::function::FnOnce::call_once
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/ops/function.rs:231
  24: &lt;F as alloc::boxed::FnBox&lt;A&gt;&gt;::call_box
             at src/libtest/lib.rs:1474
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libcore/ops/function.rs:231
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/liballoc/boxed.rs:734
  25: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:92
  26: test::run_test::run_test_inner::{{closure}}
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libstd/panicking.rs:276
             at /rustc/4b1e39b7b36d677803e40130ea29ee6d300abf6e/src/libstd/panic.rs:388
             at src/libtest/lib.rs:1429
</pre></div>


<p>Is <code>insta</code> crashing?</p>



<a name="158138712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158138712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158138712">(Feb 12 2019 at 18:11)</a>:</h4>
<p>seems like this, yeah</p>



<a name="158138807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158138807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158138807">(Feb 12 2019 at 18:12)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="cp">#[test]</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">test_method_body_filtering</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">check_ref_completion</span><span class="p">(</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;method_body_filtering&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="n">r</span><span class="s">&quot;</span>
<span class="s">            struct A {}</span>
<span class="s">            impl A {</span>
<span class="s">                fn the_method() {</span>
<span class="s">                    let x = 1;</span>
<span class="s">                    let x = 2;</span>
<span class="s">                }</span>
<span class="s">            }</span>
<span class="s">            fn foo(a: A) {</span>
<span class="s">               a.&lt;|&gt;</span>
<span class="s">            }</span>
<span class="s">            &quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>I wonder if I'm doing something wrong..</p>



<a name="158138955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158138955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158138955">(Feb 12 2019 at 18:14)</a>:</h4>
<p>I'd say this is a bug in insta. Perhaps removing existing snapshot would work?</p>



<a name="158139100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158139100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158139100">(Feb 12 2019 at 18:16)</a>:</h4>
<div class="codehilite"><pre><span></span>[pid  9365] write(2, &quot;Unrecognized option: &#39;edition&#39;&quot;, 30Unrecognized option: &#39;edition&#39;) = 30
</pre></div>


<p>wat</p>
<p>Maybe my toolchain is screwed up. Yeah.</p>



<a name="158376682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158376682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158376682">(Feb 12 2019 at 18:47)</a>:</h4>
<p>Yeah the comments filtering was for a quick and dirty solution. There's a lot of room for improvement. There are other items like that too</p>



<a name="158376830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158376830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158376830">(Feb 12 2019 at 18:49)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/pull/811" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/811">https://github.com/rust-analyzer/rust-analyzer/pull/811</a> should fix this particular instance</p>



<a name="158377135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158377135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158377135">(Feb 12 2019 at 18:53)</a>:</h4>
<p>though maybe it should check for <code>ast::FnDef</code> instead?</p>



<a name="158377884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158377884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158377884">(Feb 12 2019 at 19:02)</a>:</h4>
<p>An alternative may be to reconstruct the signature based on it's visibility, name and param list. iirc that's what rls does</p>



<a name="158378020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378020">(Feb 12 2019 at 19:04)</a>:</h4>
<p>but the signature is already available somewhere else (it gets passed to <code>CompletionItem::new</code>), so I'm not sure what's supposed to happen here</p>



<a name="158378028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378028">(Feb 12 2019 at 19:04)</a>:</h4>
<p>That way we could also format type parameters or something so that they always use the <code>where</code> syntax (or not). sort of a normalized presentation format.</p>



<a name="158378053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378053">(Feb 12 2019 at 19:05)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="w"> </span><span class="n">CompletionItem</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="p">(</span><span class="k">crate</span><span class="p">)</span><span class="w"> </span><span class="k">fn</span> <span class="nf">new</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="n">completion_kind</span>: <span class="nc">CompletionKind</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">replace_range</span>: <span class="nc">TextRange</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">label</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Into</span><span class="o">&lt;</span><span class="nb">String</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Builder</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">label</span><span class="p">.</span><span class="n">into</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="158378055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378055">(Feb 12 2019 at 19:05)</a>:</h4>
<p>oh..</p>



<a name="158378078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378078">(Feb 12 2019 at 19:05)</a>:</h4>
<p>so the signature is stored as the label, then it gets overwritten</p>



<a name="158378220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378220">(Feb 12 2019 at 19:07)</a>:</h4>
<p>never mind, one is <code>label</code>, and the other one is <code>detail</code></p>



<a name="158378231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378231">(Feb 12 2019 at 19:07)</a>:</h4>
<p>yeah detail is the fn sig</p>



<a name="158378280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378280">(Feb 12 2019 at 19:08)</a>:</h4>
<p>label is the function name iirc</p>



<a name="158378362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378362">(Feb 12 2019 at 19:09)</a>:</h4>
<p>right</p>



<a name="158378367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378367">(Feb 12 2019 at 19:09)</a>:</h4>
<p>so the function that fills in detail also fills in the signature when you're autocompleting a function call</p>



<a name="158378378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378378">(Feb 12 2019 at 19:09)</a>:</h4>
<p>(see <a href="http://call_info.rs" target="_blank" title="http://call_info.rs">call_info.rs</a>)</p>



<a name="158378570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158378570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158378570">(Feb 12 2019 at 19:11)</a>:</h4>
<p>I guess this is because <code>FnSignature</code> isn't <code>Display</code>?</p>



<a name="158379194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158379194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158379194">(Feb 12 2019 at 19:18)</a>:</h4>
<p>I don't know if that's quite where we would put it. for instance the function signature help also wants access to either a substring or a range  of offsets representing each parameter in the list so that it can underline when typing out a call (though there is no reason that whatever does that + <code>Display</code> wouldn't use the same code to figure that out</p>



<a name="158379295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/completion%20label%20filtering/near/158379295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/completion.20label.20filtering.html#158379295">(Feb 12 2019 at 19:19)</a>:</h4>
<p>good point</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>